package org.hhchat.leetcode.array;

import java.util.ArrayList;
import java.util.List;

/**
 * Created this one by HMH on 2017/10/3.
 */
public class code412_easy {

    static class Solution {
        public List<String> fizzBuzz(int n) {
            List<String> result = new ArrayList<>();
            for(int i= 0 ;i<n;i++) {
                result.add(get(i + 1));
            }
            return result;
        }

        public String get(int n) {
            StringBuilder stringBuilder = new StringBuilder();
            boolean isSpecial = false;
            if (n % 3 == 0) {
                stringBuilder.append("Fizz");
                isSpecial = true;
            }
            if (n % 5 == 0) {
                stringBuilder.append("Buzz");
                isSpecial = true;
            }
            if (!isSpecial) {
                stringBuilder.append(n);
            }
            return stringBuilder.toString();

        }

    }

    public static void main(String[] args){

    }

}
